<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>25_includes</title>
</head>

<body>
  <script>
    /**
     * includes()
     * 语法: 数组.includes('数据')
     * 作用: 查找数组中某一个数据
     * 返回值: 
     *    => 如果该 数据存在返回 true
     *    => 如果该 数据不存在返回 false
    */

    var arr = ['Jack', 'Tom', 'Rose'];

    var result1 = arr.includes('Jack');
    console.log(result1);

    var result2 = arr.includes('Peter');
    console.log(result2);

  </script>
</body>

</html>